Skip to content

SNOW-3375255: Fix 3.14 UDF bugs#4196

Closed
sfc-gh-bkogan wants to merge 15 commits into
mainfrom
bkogan-dbapi-package-resolution-fix
Closed

SNOW-3375255: Fix 3.14 UDF bugs#4196
sfc-gh-bkogan wants to merge 15 commits into
mainfrom
bkogan-dbapi-package-resolution-fix

Conversation

@sfc-gh-bkogan

@sfc-gh-bkogan sfc-gh-bkogan commented Apr 22, 2026

Copy link
Copy Markdown
Collaborator
  1. Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes SNOW-3375255

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
      • If this test skips Local Testing mode, I'm requesting review from @snowflakedb/local-testing
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am adding new credentials
    • I am adding a new dependency
    • If this is a new feature/behavior, I'm adding the Local Testing parity changes.
    • I acknowledge that I have ensured my changes to be thread-safe. Follow the link for more information: Thread-safe Developer Guidelines
    • If adding any arguments to public Snowpark APIs or creating new public Snowpark APIs, I acknowledge that I have ensured my changes include AST support. Follow the link for more information: AST Support Guidelines
  3. Please describe how your code solves the related issue.

    In resolve_imports_and_packages, non-anaconda paths branched on the truthiness of packages, which treated an empty list the same as None. This meant passing packages=[] to opt out of session-level package resolution silently skipped resolution entirely, while the anaconda path consistently differentiates between None (use session defaults) and [] (use no packages).

    Switch to an explicit is None / is not None check so non-anaconda behavior matches the anaconda path.

In resolve_imports_and_packages, non-anaconda paths branched on the
truthiness of `packages`, which treated an empty list the same as None.
This meant passing `packages=[]` to opt out of session-level package
resolution silently skipped resolution entirely, while the anaconda path
consistently differentiates between None (use session defaults) and []
(use no packages).

Switch to an explicit `is None` / `is not None` check so non-anaconda
behavior matches the anaconda path.
The PyPI gaps in UDTF package resolution (SQL Server, Databricks) are
independent of the Python version - they apply to any session whose
default artifact repository is PyPI, not just Python 3.14+. Update the
comment and the SnowparkClientException message to reflect that, and
note that on Python <3.14 a PyPI default can still occur via an
account/database/schema-level override.
The dbapi UDTF package resolution fix in this branch (dynamic package
map based on the effective artifact repository) is sufficient to unblock
the data source tests on Python 3.14, whose default artifact repository
is PyPI. Databricks and SQL Server UDTF ingestion still fail on PyPI due
to upstream package availability, but those tests already skip on
IS_PY314.
These tests rely on server-side UDTF package installation from the
default artifact repository. On Python 3.14 that default is PyPI, where:

- databricks-sql-connector pulls in thrift, which has no 3.14 wheel and
  fails the server's sdist-compile policy.
- msodbcsql is not published to PyPI at all.

Skip the affected tests on 3.14 until the Snowflake Anaconda channel
ships 3.14 builds or a PyPI-resolvable alternative exists.
@github-actions

Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@codecov-commenter

codecov-commenter commented Apr 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.15789% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.57%. Comparing base (f9f540f) to head (18a59c1).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
.../snowflake/snowpark/_internal/data_source/utils.py 58.33% 4 Missing and 1 partial ⚠️
src/snowflake/snowpark/_internal/udf_utils.py 0.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #4196       +/-   ##
===========================================
- Coverage   95.17%   82.57%   -12.60%     
===========================================
  Files         171      170        -1     
  Lines       43788    43706       -82     
  Branches     7503     7504        +1     
===========================================
- Hits        41674    36092     -5582     
- Misses       1293     6158     +4865     
- Partials      821     1456      +635     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sfc-gh-bkogan

Copy link
Copy Markdown
Collaborator Author

not needed

@github-actions github-actions Bot locked and limited conversation to collaborators Apr 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants